package com.fsc.zuul;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.netflix.zuul.EnableZuulProxy;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.ConfigurableEnvironment;

/**
* @comments Program arguments:--spring.profiles.active=prod --server.port=7000
* @author  zg
* @date 2018年8月29日
*/
@EnableZuulProxy
@EnableEurekaClient
@SpringBootApplication
public class MicroSrvZuulApplication {
	private static Class<?> cla = MicroSrvZuulApplication.class;
	private static final Logger logger = LoggerFactory.getLogger(cla);
	
	public static void main(String[] args) {
		ConfigurableApplicationContext cofigAppCont = SpringApplication.run(cla, args);
		ConfigurableEnvironment confEnv = cofigAppCont.getEnvironment();
		String appName = confEnv.getProperty("spring.application.name");
		int port = Integer.valueOf(confEnv.getProperty("server.port"));
		logger.info("MicroSrvZuulApplication started on {}, appName:{}  >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>", port, appName);
	}

}
